package com.ruoyi.campus.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
import java.util.ArrayList;

/**
 * 区域信息对象 biz_area
 * 
 * @author ruoyi
 * @date 2025-06-29
 */
public class Area extends TreeEntity
{
    private static final long serialVersionUID = 1L;

    /** 正常状态 */
    public static final String NORMAL = "0";

    /** 停用状态 */
    public static final String DISABLE = "1";

    /** 区域ID */
    private Long areaId;

    /** 区域名称 */
    @Excel(name = "区域名称")
    private String areaName;

    /** 区域状态（0正常 1停用） */
    @Excel(name = "区域状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 子区域 */
    private List<Area> children = new ArrayList<Area>();

    public Area()
    {

    }

    public Area(Area area)
    {
        this.areaId = area.getAreaId();
        this.setParentId(area.getParentId());
        this.areaName = area.getAreaName();
        this.setAncestors(area.getAncestors());
        this.setOrderNum(area.getOrderNum());
        this.status = area.getStatus();
        this.delFlag = area.getDelFlag();
    }

    public void setAreaId(Long areaId) 
    {
        this.areaId = areaId;
    }

    public Long getAreaId() 
    {
        return areaId;
    }

    public void setAreaName(String areaName) 
    {
        this.areaName = areaName;
    }

    public String getAreaName() 
    {
        return areaName;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public List<Area> getChildren()
    {
        return children;
    }

    public void setChildren(List<Area> children)
    {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("areaId", getAreaId())
            .append("areaName", getAreaName())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("orderNum", getOrderNum())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
